Micron Document
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| SparkN0de-git | SparkN0de |
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------


Commit b2f48d585305b0ceb03f51b21740e10c370d5eda


Parents : a20b4c9
Author : Dionysis Grigoropoulos <dgrig@erethon.com>
Signature : Signature validation error
Date : 2025-06-25T23:48:26+03:00

micronparser: Fix a parsing bug

Changes

1 files changed, 3 insertions(+), 0 deletions(-)


Diff

diff --git a/nomadnet/ui/textui/MicronParser.py b/nomadnet/ui/textui/MicronParser.py
index 70f9f0f..00507a7 100644
--- a/nomadnet/ui/textui/MicronParser.py
+++ b/nomadnet/ui/textui/MicronParser.py
@@ -148,6 +148,9 @@ def parse_line(line, state, url_delegate):
elif first_char == "-":
if len(line) == 2:
divider_char = line[1]
+ # Control characters don't make sense here and otherwise crash nomadnet
+ if ord(divider_char) < 32:
+ divider_char = "\u2500"
else:
divider_char = "\u2500"
if state["depth"] == 0:


──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────